package com.example.fresheveryday.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.fresheveryday.mapper.BlogMapper;
import com.example.fresheveryday.po.Blog;
import com.example.fresheveryday.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements BlogService {
  @Autowired
  private BlogMapper blogMapper;

  @Override
  public IPage<Blog> getAllBlog(IPage<Blog> page) {
    return blogMapper.getAllBlog(page);
  }

  @Override
  public IPage<Blog> getBlogByConditions(IPage<Blog> page, Wrapper wrapper) {
    return blogMapper.getBlogByConditions(page,wrapper);
  }
  @Override
  public List<Blog> getSix(){
    return blogMapper.getSix();
  }
  @Override
  public List<Blog> getThree() {
    return blogMapper.getThree();
  }

  @Override
  public int countByConditions(Wrapper wrapper){return blogMapper.countByConditions(wrapper);}
}
